package com.lian.controller;


import com.lian.pojo.Result;
import com.lian.pojo.Type;
import com.lian.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lsx
 * @since 2024-05-07
 */
@RestController
@RequestMapping("/api/type")
public class TypeController {
    @Autowired
    TypeService typeService;
    @GetMapping("/getTree")
    @CrossOrigin(origins = "*")
    public Result getTypeTree(){
        List<Type> list =typeService.getTypeTree();
        return Result.success(list);
    }
}

